#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
//	system("start https://www.lanqiao.cn/problems/8120/learning/");

    string s;
    cin >> s;

    auto R = [](string s) {
        return s.end()[-1] + s.substr(0, s.size() - 1);
    };
    auto L = [](string s) {
        return s.substr(1, s.size() - 1) + s[0];
    };

    if(L(s) == R(s))
        cout << "YES";
    else
        cout << "NO";

    return 0;
}

